Imports DotNetNuke.UI.WebControls
Imports System.IO
Imports System.Xml

Partial Class TreeCheckBoxMode
    Inherits System.Web.UI.Page

    Protected Overrides Sub OnInit(ByVal e As System.EventArgs)
        MyBase.OnInit(e)
        DotNetNuke.UI.Utilities.ClientAPI.HandleClientAPICallbackEvent(Me)
    End Sub

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If Page.IsPostBack = False Then
            Dim xmlDoc As XmlDocument = New XmlDocument()
            xmlDoc.Load(Server.MapPath(ResolveUrl("~/xml/filemenu.xml")))
            MyDNNTree.LoadXml(xmlDoc.InnerXml)
        End If
        MyDNNTree.CheckBoxMode = CType(ddlCheckBoxMode.SelectedValue, eCheckBoxMode)

    End Sub

    Private Sub Page_PreRender(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.PreRender
        MyDNNTree.ClearSelections()
    End Sub

    Private Sub MyDNNTree_PopulateOnDemand(ByVal source As Object, ByVal e As DNNTreeEventArgs) Handles MyDNNTree.PopulateOnDemand
        AddPODNodes(e.Node)
    End Sub

    Private Sub AddPODNodes(ByVal parent As DNNNode)
        Dim node As MenuNode = New MenuNode
        node.ID = "20"
        node.Text = "Copy (POD)"
        node.ClickAction = eClickAction.None
        parent.DNNNodes.Add(node)
        node = New MenuNode
        node.ID = "21"
        node.Text = "Paste (POD)"
        node.ClickAction = eClickAction.None
        parent.DNNNodes.Add(node)
    End Sub


End Class
